home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Tool Chest / Dev.CD Feb 97 TC.toast / Sample Code / Interapplication Communication / MenuScripter 4.0 / Sources / PLStrs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-09  |  641 b   |  36 lines  |  [TEXT/KAHL]

  1. /*
  2.     PLStrs.c
  3.     
  4.     Version 3.1
  5.     
  6.     Copyright © 1995 Apple Computer, Inc., all rights reserved.
  7.     
  8.     MenuScripter by Nigel Humphreys and Jon Lansdell
  9.     AppleEvent to script extensions by Greg Sutton
  10. */
  11.  
  12. #include "PLStrs.h"
  13.  
  14. #include <memory.h>
  15.  
  16. pascal StringPtr     PLstrcpy(StringPtr str1, StringPtr str2)
  17.     {
  18.       BlockMove(str2, str1, str2[0] + 1);
  19.       return(str1);
  20.     }
  21.     
  22. pascal StringPtr    PLstrcat(StringPtr str1, StringPtr str2)
  23.     {
  24.         long copyLen;
  25.         
  26.       if (str1[0] + 1 + str2[0]>255)
  27.         copyLen = 255 - str1[0];
  28.       else
  29.           copyLen = str2[0];
  30.           
  31.       BlockMove(&str2[1], str1 + 1 + str1[0], copyLen);
  32.       str1[0] += copyLen;
  33.       
  34.       return(str1);
  35.     }
  36.